//
//  AllCommentCell.m
//  CarLife
//
//  Created by yu on 2019/4/2.
//  Copyright © 2019年 jpas. All rights reserved.
//

#import "AllCommentCell.h"

@implementation AllCommentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    UIView *contentView = self.contentView;
    
    _iconImgView.sd_layout
    .leftSpaceToView(contentView, 16)
    .topSpaceToView(contentView, 13)
    .widthIs(kAutoWidth(36))
    .heightEqualToWidth();
    
    _nicknameLabel.sd_layout
    .leftSpaceToView(_iconImgView, 11)
    .topEqualToView(_iconImgView)
    .heightIs(20);
    [_nicknameLabel setSingleLineAutoResizeWithMaxWidth:200];
    
    _timeLabel.sd_layout
    .leftEqualToView(_nicknameLabel)
    .bottomEqualToView(_iconImgView)
    .heightIs(17);
    [_timeLabel setSingleLineAutoResizeWithMaxWidth:200];
    
    {
    _iconImgView2.sd_layout
    .leftSpaceToView(_containerView, 5)
    .topSpaceToView(_containerView, 5)
    .widthIs(kAutoWidth(16))
    .heightEqualToWidth();
    
    _nicknameLabel2.sd_layout
    .centerYEqualToView(_iconImgView2)
    .leftSpaceToView(_iconImgView2, 5);
    [_nicknameLabel2 setSingleLineAutoResizeWithMaxWidth:200];
    
    _contentLabel2.sd_layout
    .leftEqualToView(_nicknameLabel2)
    .rightSpaceToView(_containerView, 5)
    .topSpaceToView(_nicknameLabel2, 5)
    .autoHeightRatio(0);
    
    _containerView.sd_layout
    .leftEqualToView(_timeLabel)
    .rightSpaceToView(contentView, 16)
    .topSpaceToView(_timeLabel, 8)
    .autoHeightRatio(0);
    
    [_containerView setupAutoHeightWithBottomView:_contentLabel2 bottomMargin:5];
    }
    
    _contentLabel.sd_layout
    .leftEqualToView(_nicknameLabel)
    .rightSpaceToView(contentView, 16)
    .topSpaceToView(_containerView, 8)
    .autoHeightRatio(0);
    
    
    UIView *lineView = [[UIView alloc] init];
    lineView.backgroundColor = kLineGrayColor;
    [contentView addSubview:lineView];
    
    lineView.sd_layout
    .leftEqualToView(_nicknameLabel)
    .bottomSpaceToView(contentView, 0)
    .rightSpaceToView(contentView, 0)
    .heightIs(0.5);
    
    
    [self setupAutoHeightWithBottomView:_contentLabel bottomMargin:10];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
